package cn.lyjuan.payment.third.base.common.enums.impl;

import cn.lyjuan.payment.third.base.common.enums.ICodeEnum;

/**
 * @author arvin
 * desc payment-third cn.lyjuan.payment.third.base.common.enums.impl
 * 2021/3/9 13:52
 */
public enum IapRefundTypeEnum implements ICodeEnum {

    /**
     * 不是退款
     */
    NO(0, "NO"),
    /**
     * 是退款
     */
    YES(1, "YES"),
    //
    ;

    private Integer code;

    private String desc;

    IapRefundTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }


    @Override
    public Integer getCode() {
        return null;
    }

    public static IapRefundTypeEnum from(String desc) {
        if (null == desc || desc.length() == 0)
            throw new NullPointerException("desc cannot be null");

        IapRefundTypeEnum[] es = IapRefundTypeEnum.class.getEnumConstants();
        for (IapRefundTypeEnum e : es) {
            if (e.desc.equals(desc))
                return e;
        }
        throw new RuntimeException("unsupported simple status enum: " + desc);
    }
}
